from selenium import webdriver
import time

from selenium.webdriver.common.by import By

wd = webdriver.Chrome()
url = 'https://www.baidu.com'
wd.get(url)
time.sleep(2)
search_box = wd.find_element(By.ID, 'kw').send_keys('周杰伦')
time.sleep(3)
baiduyixia = wd.find_element(By.XPATH, '//*[@id="su"]')
time.sleep(4)
js_bottom = 'document.documentElement.scrollTop=100000'
wd.execute_script(js_bottom)
time.sleep(4)
next_page = wd.find_element(By.CSS_SELECTOR, '#page>div> a.n').click()
wd.back()
time.sleep(4)
wd.forward()
time.sleep(4)
print(wd.page_source)
wd.close()




